FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }}

{% if install_type == 'binary' %}

RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
    && /bin/false

{% elif install_type == 'source' %}

ADD neutron-networking-sfc-agent-archive /neutron-networking-sfc-agent-source
RUN ln -s neutron-networking-sfc-agent-source/* neutron_networking-sfc-agent \
    && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /neutron_networking-sfc-agent \
    && cp /neutron_networking-sfc-agent/etc/neutron/rootwrap.d/* /etc/neutron/rootwrap.d \
    && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/neutron/rootwrap.conf

{% endif %}

COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start
RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start

{% block neutron_networking_sfc_agent_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}

USER neutron
